<?php

/**
 * Documentacion form base class.
 *
 * @method Documentacion getObject() Returns the current form's model object
 *
 * @package    ecampus
 * @subpackage form
 * @author     Grupo 608
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseDocumentacionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_documento'   => new sfWidgetFormInputHidden(),
      'archivo'        => new sfWidgetFormTextarea(),
      'fecha_creacion' => new sfWidgetFormDateTime(),
      'id_curso'       => new sfWidgetFormInputText(),
      'id_docente'     => new sfWidgetFormInputText(),
      'id_entregable'  => new sfWidgetFormInputText(),
      'id_tp'          => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id_documento'   => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_documento')), 'empty_value' => $this->getObject()->get('id_documento'), 'required' => false)),
      'archivo'        => new sfValidatorString(array('required' => false)),
      'fecha_creacion' => new sfValidatorDateTime(array('required' => false)),
      'id_curso'       => new sfValidatorInteger(),
      'id_docente'     => new sfValidatorInteger(),
      'id_entregable'  => new sfValidatorInteger(),
      'id_tp'          => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('documentacion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Documentacion';
  }

}
